package com.itlong.cloud.operate.service.impl;

import com.itlong.cloud.operate.dao.IOperateTimeTaskDeveloperLogDao;
import com.itlong.cloud.operate.service.IOperateTimeTaskDeveloperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * <desc>
 *      运营-开发者日志及操作日志业务层接口实现类
 * </desc>
 *
 * @createDate2020/11/9
 **/
@Service
public class OperateTimeTaskDeveloperLogServiceImpl implements IOperateTimeTaskDeveloperLogService {

    @Autowired
    private IOperateTimeTaskDeveloperLogDao iOperateTimeTaskDeveloperLogDao;

    /**
     * <desc>
     *      删除3月前开发者访问日志
     * </desc>
     *
     * @param
     * @return 受影响行数
     * @Author Zhu.yj
     * @createDate  2020/11/9
     */
    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public void deleteDeveloperLog() throws Exception{
        iOperateTimeTaskDeveloperLogDao.moveDeveloperLogDataToHistory();
        iOperateTimeTaskDeveloperLogDao.deleteDeveloperLog();
    }

    /**
     * <desc>
     *      删除3月前登录日志
     * </desc>
     *
     * @param
     * @return 受影响行数
     * @Author Zhu.yj
     * @createDate  2020/11/9
     */
    @Override
    public void deleteLoginLog() throws Exception{
        iOperateTimeTaskDeveloperLogDao.moveLoginLogDataToHistory();
        iOperateTimeTaskDeveloperLogDao.deleteLoginLog();
    }
}
